package Emailhandler;
import javax.mail.PasswordAuthentication;

/**
 * En implementation af Authenticator der skal bruges i forbindelse med Google's e-mailsystem.
 * 
 * @author Daniel Koch
 */
public class MailerAuth extends javax.mail.Authenticator {
    private String username;
    private String password;

    /**
     * Initialiserer MailerAuth med username og password.
     *
     * @param username
     * @param password
     */
    public MailerAuth(String username, String password) {
        this.username = username;
        this.password = password;
    }

    /**
     * @return Et PasswordAuthentication-objekt initialiseret med username og password.
     */
    protected PasswordAuthentication getPasswordAuthentication() {
        return new PasswordAuthentication(this.username, this.password);
    }
}
